package com.zdb.demo.design.pattern.creational.singleton;

public class ReflectHungrySingleton {

    private static ReflectHungrySingleton instance = new ReflectHungrySingleton();

    private ReflectHungrySingleton() {
        if(instance != null) {
            throw new RuntimeException("禁止生成多个实例");
        }
    }

    public static ReflectHungrySingleton getInstance() {
        return instance;
    }
}
